package com.mall.cart.feign;

import com.mall.cart.model.Cart;
import com.mall.common.util.RespResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Darren
 * @date 2022-08-29 10:19
 * Description：
 */
@FeignClient("mall-cart")
@RequestMapping("/cart")
public interface CartFeign {

    @PostMapping("/{id}/{num}")
    @ApiOperation(value = "新增")
    RespResult addCart(@PathVariable("id") String id, @PathVariable("num") Integer num);

    @GetMapping
    @ApiOperation(value = "根据用户名称查询购物车列表")
    RespResult<List<Cart>> list();

    @PostMapping("/list")
    @ApiOperation(value = "购物车结算")
    RespResult<List<Cart>> list(@RequestBody List<String> ids);

    @DeleteMapping("/list")
    @ApiOperation(value = "购物车删除")
    RespResult deleteCart(@RequestBody List<String> ids);

}
